#include <iostream>
#include <gmpxx.h>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cstdlib>

using namespace std;

string mpq_to_decimal(mpq_class value, int precision)
{
  if (value == 0)
  {
    return "0";
  }
  
  string decimal;
  mpz_class numerator = value.get_num();
  mpz_class denominator = value.get_den();
  
  mpz_class total_part = numerator / denominator;
  decimal += total_part.get_str();
  mpz_class rest = abs(numerator % denominator);
  
  if (rest != 0)
  {
    decimal += '.';
    
    int count = 0;
    rest *= 10;
    bool addZero = true;
    while (count < precision)
    {
      mpz_class tmp = rest / denominator;
      if (tmp == 0 && rest % denominator != 0)
      {
	rest *= 10;
	if (addZero)
	{
	  decimal += '0';
	  count++;
	}
	addZero = true;
      }
      else
      {
	decimal += tmp.get_str();
	rest -= tmp * denominator;
	addZero = false;
	count++;
      }
    }
  }
  
  int shift = 0;
  for (string::reverse_iterator rit = decimal.rbegin(); rit != decimal.rend(); ++rit)
  {
    if (*rit != '0')
    {
      if (*rit == '.')
      {
	shift++;
      }
      break;
    }
    
    shift++;
  }
  
  decimal = decimal.substr(0, decimal.size() - shift);
  
  return decimal;
}

int get_period(vector<mpz_class> &elements, int count)
{
  for (int p = 1; p <= count; p++)
  {
    bool period_founded = true;
    for (int i = 0; i < elements.size() - p; i++)
    {
      if (elements[i] != elements[i + p])
      {
	period_founded = false;
	break;
      }
    }
    
    if (period_founded)
    {
      return p;
    }
  }
  
  return count;
}

int main (int argc, char* argv[])
{
  int precision = atoi(argv[1]);
  
  mpq_class average, variance = 0, sum = 0, average_square;
  mpz_class element;
  int count = 0;
  vector<mpz_class> elements;
  
  ios_base::sync_with_stdio(false);
  while (cin >> element)
  {
    elements.push_back(element);
    count++;
    sum += element;
  }
  
  average = sum / count;
  average_square = average * average;
  
  for(vector<mpz_class>::iterator it = elements.begin(); it != elements.end(); it++)
  {
    variance += *it * *it - average_square;
  }
  
  variance /= count;
  
  //mpq_class test (5, 1000);
  //cout<<test<<endl;
  //cout<<average<<endl;
  //cout<<variance<<endl;
  cout<<mpq_to_decimal(average, precision)<<endl;
  cout<<mpq_to_decimal(variance, precision)<<endl;
  cout<<get_period(elements, count)<<endl;
  //cout<<endl;
    
  return 0;
}